<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/11/28 0028
  Time: 11:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<script>
    function atest() {
       var xhr =  new XMLHttpRequest();

       xhr.onreadystatechange=function () {
           if(xhr.readyState==4){
               console.log(document.getElementById("reset"))
               document.getElementById("reset").setAttribute("value",xhr.responseText)
               document.getElementById("d2").value=xhr.responseText
           }
       }
        xhr.open("get","${pageContext.request.contextPath}/tservlet",true);
        xhr.send(null);
    }
</script>
<body>
<input type="text" value="测试" id="reset" onkeyup="atest()">
<input type="text" id="d2">
<ul>
    <li>ying</li>
    <li>ying</li>
    <li>ying</li>
    <li>ying</li>
    <li>ying</li>
    <li>ying</li>
</ul>
</body>
</html>
